home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / blitzbasic / riblitzlibs.lha / riblitzlibs / func / BankTest.asc next >
Encoding:
Text File  |  1994-04-26  |  1.3 KB  |  87 lines

  1. ;##############################
  2. ;# Example 1.0 - Memory Banks #
  3. ;##############################
  4. ; By Steven Matty
  5. ;
  6. ; This program runs through most of the memory bank commands
  7. ; e.g. BLoad / BSave / Reserve / CopyBank / Erase / EraseAll / Start / Length
  8.  
  9. NPrint "Loading S:startup-sequence to Bank 0"
  10. success=BLoad("S:startup-sequence",0)
  11. If success
  12.   NPrint "Okay!"
  13. Else
  14.   NPrint "Error!"
  15.   End
  16. EndIf
  17.  
  18. VWait 50
  19.  
  20. NPrint "Saving Bank 0 To RAM:Plop"
  21. success=BSave("Ram:Plop",0)
  22. If success
  23.   NPrint "Okay!"
  24. Else
  25.   NPrint "Error!"
  26.   End
  27. EndIf
  28.  
  29. VWait 50
  30.  
  31. NPrint "Copying Bank 0 to Bank 1.."
  32. success=CopyBank(0,1)
  33. If success
  34.   NPrint "Okay!"
  35. Else
  36.   NPrint "Error!"
  37.   End
  38. EndIf
  39.  
  40. VWait 50
  41.  
  42. NPrint "Allocating Bank 1 (CHIP RAM).."
  43. success=Reserve(1,Length(0),%10)
  44. If success
  45.   NPrint "Okay!"
  46. Else
  47.   NPrint "Error!"
  48.   End
  49. EndIf
  50.  
  51. VWait 50
  52.  
  53. NPrint "Erasing Bank 1.."
  54. Erase 1
  55.  
  56. VWait 50
  57.  
  58. NPrint "Allocating Bank 1 (4000 bytes PUBLIC RAM).."
  59. success=Reserve(1,4000)
  60. If success
  61.   NPrint "Okay!"
  62. Else
  63.   NPrint "Error!"
  64.   End
  65. EndIf
  66.  
  67. VWait 50
  68.  
  69. NPrint "Start of Bank 0  = ",Start(0)
  70. NPrint "Length Of Bank 0 = ",Length(0)," bytes."
  71. NPrint "Start of Bank 1  = ",Start(1)
  72. NPrint "Length Of Bank 1 = ",Length(1)," bytes."
  73.  
  74. VWait 50
  75.  
  76. NPrint "Next Free Bank = ",NextBank(0)
  77.  
  78. VWait 50
  79.  
  80. NPrint "Erasing ALL Banks..."
  81. EraseAll
  82. NPrint "Press the mouse button..."
  83. MouseWait
  84. End
  85.  
  86.  
  87.